package com.cslc.wechat.terminal.dao;

import junit.framework.Assert;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import com.cslc.wechat.common.bean.Terminal;
import com.cslc.wechat.test.BaseTestCase;

public class TerminalDAO_T extends BaseTestCase{

	private ITerminalDAO  terminalDAO;
	@Before
	protected void setUp() throws Exception {
		super.setUp();
		this.terminalDAO = (ITerminalDAO) super.applicationContext.getBean("terminalDAOImpl");
	}
	@After
	protected void tearDown() throws Exception {
	}
	
	//@Test
	public final void saveTerminal() {
        Terminal terminal =new Terminal();
        terminal.setTerminal_no("13910733521");
        //terminal.setUser_id(0);
        terminalDAO.save(terminal);
	}
	
	@Test
	public final void testFindTerminalByUserIdAndTermId() {
		Terminal tempTerminal = terminalDAO.findTerminal(14, "234567");
		Assert.assertNotNull(tempTerminal);
	}
	
	@Test
	public final void testfindTerminalByUserId() {
		Terminal tempTerminal = terminalDAO.findTerminalByUserId(14);
		Assert.assertNotNull(tempTerminal);
	}
	
	@Test
	public final void test_deleteTerminalByUserId() {
		terminalDAO.deleteTerminalByUserId(14);
	}
}
